import java.util.HashMap;

class SymbolTable {
    // 符号表类
    private HashMap<String, Record> hash; // 哈希表用于存储符号记录

    // 构造函数
    public SymbolTable() {
        hash = new HashMap<>();
    }

    // 添加符号
    public void addSymbol(String name) {
        if (!hash.containsKey(name)) {
            hash.put(name, new SymbolRecord(name, null));
        }
    }

    // 移除符号
    public void removeSymbol(String name) {
        hash.remove(name);
    }

    // 获取符号的值
    public Object getSymbolValue(String name) {
        Record record = hash.get(name);
        return (record != null) ? record.getValue() : null;
    }

    // 查找符号是否存在
    public boolean lookupSymbol(String name) {
        return hash.containsKey(name);
    }

    // 打印符号表
    public void printTable() {
        for (String key : hash.keySet()) {
            System.out.println("Symbol: " + key + "\t" +getSymbolValue(key));
        }
    }
}